Importing Pandas


In [ ]:
# Start by importing Pandas (CLARIFICATION: from python, not from south central China)

Creating a Series


In [ ]:
# Create a Series of three numbers: 10, 20 and 10.

In [ ]:
# Create a Series of three objects: 'red, 'blue', 'red'

Creating a DataFrame


In [ ]:
# Create an empty DataFrame, called 'df'.

In [ ]:
# Create a new column on the dataframe, and assign it the first Series you created.

In [ ]:
# Create another column on the dataframe, and assign it the second Series you created.

Reading a DataFrame


In [ ]:
# Read the 'avengers.csv" into a DataFrame, called 'avengers'. 
# The path the file is '../data/avengers.csv"

Previewing a DataFrame


In [ ]:
# Show the first 5 rows of the DataFrame.

In [ ]:
# Show the first 20 rows of the DataFrame. 
# Read the Pandas documentation for '.head()' to learn how.

In [ ]:
# Show the last 5 rows of the DataFrame.

Shape of a DataFrame


In [ ]:
# Show the shape of the DataFrame.

Data types in a DataFrame


In [ ]:
# Show the data types of the DataFrame

Setting the index of a DataFrame


In [ ]:
# Set the index of the DataFrame as 'Years since joining'.

Sorting the index of a DataFrame


In [ ]:
# Sort the index of the DataFrame as descending.
# Read the Pandas documentation for 'sort_index()' to learn how.

Resetting the index of a DataFrame


In [ ]:
# Reset the index of the DataFrame.